﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Web;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Security;
using Projekt_2_ASP.NET;
using WebShopData;

namespace Projekt_2_ASP.NET
{
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterOpenAuth();
        }

        void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown

        }

        void Application_Error(object sender, EventArgs e)
        {
            // Code that runs when an unhandled error occurs
            Exception ex = Server.GetLastError();
            Application["Exception"] = ex;
            //Response.Write(ex.Message);
            Response.Redirect("Error.aspx");
            Server.ClearError();
        }

        void Session_Start(object sender, EventArgs e)
        {
            //Order test = new Order();
            //test.OrderRows.Add(new OrderRow(1, 1));
            //test.OrderRows.Add(new OrderRow(2, 2));
            //Session["Order"] = test;
            Session["Order"] = new Order();
        }
    }
}
